package com.example.demo.utils;

import java.util.concurrent.atomic.AtomicInteger;

public class OptimisticLockAdder implements Runnable {
    //乐观锁
    //整数修改：原子类
    private AtomicInteger count = new AtomicInteger();

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("count---->" + count.incrementAndGet());
        }
    }
}
